function [K, data, horz, vert] = loadModelMat (image)
%LOADMODELMAT this function initiate the model and data parameters needed
%for the tiered labeling. (the data and model are very old version)s
%   Detailed explanation goes here

    K = 4;
    lambda = 20;
    inMatHorz = [ 0,1000,5,100 ;
                          1000,0,100,100 ;
                          1000,100,0,5 ;
                          5,100,1000,0      ];

    inMatVert = [ 0,100,5,5;
                          1000,0,1000,1000;
                          1000,5,0,100;
                          1000,5,100,0       ];                  

    horz = inMatHorz * lambda;
    vert = inMatVert * lambda;

    % data model
    [width,height] = size(image);
    fg = zeros(size(image));
    bg = zeros(size(image));
    data = cell(K,1);
    robustThreshold = 300;

    for y = 1 : height
        for x = 1 : width
            fg( x, y) = abs(150-image( x, y));
            bg( x, y) = abs(50-image( x, y));
            if fg( x, y ) > robustThreshold
                fg( x, y ) = robustThreshold;
            end
            if bg( x, y ) > robustThreshold
                bg( x, y ) = robustThreshold;
            end
        end
    end

    data(1) = {bg};
    data(2) = data(1);
    isequal(data(2),data(1))
    for i = 3:K
        data(i) = {fg};
    end
    
end

